package reifnsk.minimap;

import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.Material;
import net.minecraft.src.TileEntity;
import net.minecraft.src.Vec3Pool;
import net.minecraft.src.WorldChunkManager;

class BlockAccess implements IBlockAccess
{
    int blockId;
    TileEntity blockTileEntity;
    int lightBrightnessForSkyBlocks;
    float brightness;
    float getLightBrightness;
    int blockMetadata;
    WorldChunkManager worldChunkManager;
    int worldHeight = 256;

    /**
     * Returns the block ID at coords x,y,z
     */
    public int getBlockId(int i, int j, int k)
    {
        return this.blockId;
    }

    /**
     * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists
     */
    public TileEntity getBlockTileEntity(int i, int j, int k)
    {
        return this.blockTileEntity;
    }

    /**
     * Any Light rendered on a 1.8 Block goes through here
     */
    public int getLightBrightnessForSkyBlocks(int i, int j, int k, int l)
    {
        return this.lightBrightnessForSkyBlocks;
    }

    public float getBrightness(int i, int j, int k, int l)
    {
        return this.brightness;
    }

    /**
     * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light
     * values aren't linear for brightness). Args: x, y, z
     */
    public float getLightBrightness(int i, int j, int k)
    {
        return this.getLightBrightness;
    }

    /**
     * Returns the block metadata at coords x,y,z
     */
    public int getBlockMetadata(int i, int j, int k)
    {
        return this.blockMetadata;
    }

    /**
     * Returns the block's material.
     */
    public Material getBlockMaterial(int i, int j, int k)
    {
        Block block = Block.blocksList[this.blockId];
        return block == null ? Material.air : block.blockMaterial;
    }

    /**
     * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z
     */
    public boolean isBlockOpaqueCube(int i, int j, int k)
    {
        Block block = Block.blocksList[this.blockId];
        return block != null && block.isOpaqueCube();
    }

    /**
     * Indicate if a material is a normal solid opaque cube.
     */
    public boolean isBlockNormalCube(int i, int j, int k)
    {
        Block block = Block.blocksList[this.blockId];
        return block != null && block.blockMaterial.isOpaque() && block.renderAsNormalBlock();
    }

    /**
     * Returns true if the block at the specified coordinates is empty
     */
    public boolean isAirBlock(int i, int j, int k)
    {
        return Block.blocksList[this.blockId] == null;
    }

    /**
     * Gets the biome for a given set of x/z coordinates
     */
    public BiomeGenBase getBiomeGenForCoords(int i, int j)
    {
        return null;
    }

    /**
     * Returns current world height.
     */
    public int getHeight()
    {
        return this.worldHeight;
    }

    /**
     * set by !chunk.getAreLevelsEmpty
     */
    public boolean extendedLevelsInChunkCache()
    {
        return false;
    }

    /**
     * Returns true if the block at the given coordinate has a solid (buildable) top surface.
     */
    public boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3)
    {
        return false;
    }

    /**
     * Return the Vec3Pool object for this world.
     */
    public Vec3Pool getWorldVec3Pool()
    {
        return null;
    }

    /**
     * Is this block powering in the specified direction Args: x, y, z, direction
     */
    public int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4)
    {
        return 0;
    }
}
